fix: change BodySerializer from any to unknown for strict TypeScript support#3471
fix: change BodySerializer from any to unknown for strict TypeScript support#3471
any to unknown for strict TypeScript support#3471Conversation
|
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: ad11be2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…support Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
…ple files Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
any to unknown for strict TypeScript support
|
@copilot CI fails on typecheck, please fix. I also think instead of replacing this: bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
body: T,
): FormData => {with this: bodySerializer: (body: unknown): FormData => {you should've done just this: bodySerializer: <T extends Record<string, unknown> | Array<Record<string, unknown>>>(
body: T,
): FormData => { |
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
... Fixed in commit
|
|
@copilot tests fail, you probably need to run |
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Fixed in commit |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3471 +/- ##
==========================================
+ Coverage 40.15% 40.30% +0.15%
==========================================
Files 478 483 +5
Lines 17496 17567 +71
Branches 5306 5322 +16
==========================================
+ Hits 7025 7080 +55
- Misses 8421 8431 +10
- Partials 2050 2056 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@hey-api/codegen-core
@hey-api/json-schema-ref-parser
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/shared
@hey-api/types
@hey-api/vite-plugin
commit: |
3d55ad8 to
21d860a
Compare
|
Error agent completed without reporting progress |

BodySerializer = (body: any) => anytoBodySerializer = (body: unknown) => unknownin source bundle filesformDataBodySerializer,jsonBodySerializer,urlSearchParamsBodySerializer) to acceptunknownparameter in both source filesserializedBody: undefinedinitialization by usingundefined as string | undefinedso TypeScript doesn't inferundefinedliteral typeopts.serializedBody = opts.bodySerializer(opts.body) as string | undefinedto explicitly cast theunknownreturn type(body: object)parameter type — changed to(body: unknown)to match newBodySerializersignatureclient.gen.tsfiles with the same fixessse-tanstack-react-querysnapshot files (added in merge from main):core/bodySerializer.gen.ts— updated from oldanytype to newunknowntypeclient/client.gen.ts— updated withas string | undefinedcastsOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.